# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2023年02月23日
"""
import docx

# from docx.enum.text import WD_ALIGN_PARAGRAPH

myDocument = docx.Document('年度收入.docx')
myTable = myDocument.tables[0]
for j in range(1,len(myTable.columns)):
	mySum=0
	for i in range(1,len(myTable.rows)-1):
		mySum+=int(myTable.column_cells(j)[i].text)
		myTable.column_cells(j)[5].text=str(mySum)

myDocument.save("02散文名篇.docx")
